APPNAME=cl

//PREFIX ?=`pwd`/../../bin/   

#定义一个变量指定文件和安装路径

LIBPATH= `pwd`/../../lib 


CFLAGS+=-I `pwd`/../../include   
CFLAGS+=-I `pwd`/../../../cjson/cJSON-1.7.15/ 
LDFLAGS+=-L ${LIBPATH} -ltemp
LDFLAGS+=-L `pwd`/../../../cjson/cJSON-1.7.15/ -lcjson


CC=gcc
AR=ar 

all: 
	${CC} ${CFLAGS} -g main.c -o ${APPNAME} ${LDFLAGS} -lmosquitto -lm 

clean:
	rm -f ${APPNAME}
	rm -f *.so
	rm -f *.a

distclean:clean
	rm -f *.log
	rm -f *.db

run:
	export LD_LIBRARY_PATH=`pwd`/../../lib/ && ./${APPNAME} -p 3 

install:
	mkdir -p ${PREFIX}
	cp ${APPNAME} ${PREFIX}

